<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="联系人编码" prop="cContactCode">
        <el-input
          v-model="queryParams.cContactCode"
          placeholder="请输入联系人编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所属供应商" prop="cVenCode">
        <el-input
          v-model="queryParams.cVenCode"
          placeholder="请输入所属供应商"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系人名称" prop="cContactName">
        <el-input
          v-model="queryParams.cContactName"
          placeholder="请输入联系人名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="称呼" prop="cAppellation">
        <el-input
          v-model="queryParams.cAppellation"
          placeholder="请输入称呼"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="性别" prop="bcSexID">
        <el-input
          v-model="queryParams.bcSexID"
          placeholder="请输入性别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生日" prop="dBirthday">
        <el-date-picker clearable
          v-model="queryParams.dBirthday"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择生日">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="籍贯" prop="cNative">
        <el-input
          v-model="queryParams.cNative"
          placeholder="请输入籍贯"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职务" prop="bcDutyID">
        <el-input
          v-model="queryParams.bcDutyID"
          placeholder="请输入职务"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="直接上级" prop="cSuperiorID">
        <el-input
          v-model="queryParams.cSuperiorID"
          placeholder="请输入直接上级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="手机" prop="cMobilePhone">
        <el-input
          v-model="queryParams.cMobilePhone"
          placeholder="请输入手机"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="办公电话" prop="cOfficePhone">
        <el-input
          v-model="queryParams.cOfficePhone"
          placeholder="请输入办公电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="家庭电话" prop="cHomePhone">
        <el-input
          v-model="queryParams.cHomePhone"
          placeholder="请输入家庭电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="呼机" prop="cCall">
        <el-input
          v-model="queryParams.cCall"
          placeholder="请输入呼机"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子邮件" prop="cEmail">
        <el-input
          v-model="queryParams.cEmail"
          placeholder="请输入电子邮件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="个人主页" prop="cHomePage">
        <el-input
          v-model="queryParams.cHomePage"
          placeholder="请输入个人主页"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="  工作地址 " prop="cWorkAddress">
        <el-input
          v-model="queryParams.cWorkAddress"
          placeholder="请输入  工作地址 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="邮政编码" prop="cZipcode">
        <el-input
          v-model="queryParams.cZipcode"
          placeholder="请输入邮政编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="婚姻状况" prop="bcMarriageID">
        <el-input
          v-model="queryParams.bcMarriageID"
          placeholder="请输入婚姻状况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="家庭成员" prop="cHomeMember">
        <el-input
          v-model="queryParams.cHomeMember"
          placeholder="请输入家庭成员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="家庭住址" prop="cHomeAddress">
        <el-input
          v-model="queryParams.cHomeAddress"
          placeholder="请输入家庭住址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="个人爱好" prop="bcTasteID">
        <el-input
          v-model="queryParams.bcTasteID"
          placeholder="请输入个人爱好"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否主要联系人" prop="bMajor">
        <el-input
          v-model="queryParams.bMajor"
          placeholder="请输入是否主要联系人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="cMemo">
        <el-input
          v-model="queryParams.cMemo"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负责人 " prop="cPrincipal">
        <el-input
          v-model="queryParams.cPrincipal"
          placeholder="请输入负责人 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人" prop="cCreator">
        <el-input
          v-model="queryParams.cCreator"
          placeholder="请输入创建人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变更人" prop="cRevisor">
        <el-input
          v-model="queryParams.cRevisor"
          placeholder="请输入变更人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变更时间" prop="dModifyDate">
        <el-date-picker clearable
          v-model="queryParams.dModifyDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择变更时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="创建日期" prop="dCreateDate">
        <el-date-picker clearable
          v-model="queryParams.dCreateDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine1">
        <el-input
          v-model="queryParams.cConDefine1"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine2">
        <el-input
          v-model="queryParams.cConDefine2"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine3">
        <el-input
          v-model="queryParams.cConDefine3"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine4">
        <el-input
          v-model="queryParams.cConDefine4"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine5">
        <el-input
          v-model="queryParams.cConDefine5"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine6">
        <el-input
          v-model="queryParams.cConDefine6"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine7">
        <el-input
          v-model="queryParams.cConDefine7"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine8">
        <el-input
          v-model="queryParams.cConDefine8"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine9">
        <el-input
          v-model="queryParams.cConDefine9"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine10">
        <el-input
          v-model="queryParams.cConDefine10"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine11">
        <el-input
          v-model="queryParams.cConDefine11"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine12">
        <el-input
          v-model="queryParams.cConDefine12"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine13">
        <el-input
          v-model="queryParams.cConDefine13"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine14">
        <el-input
          v-model="queryParams.cConDefine14"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine15">
        <el-date-picker clearable
          v-model="queryParams.cConDefine15"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择${comment}">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="${comment}" prop="cConDefine16">
        <el-date-picker clearable
          v-model="queryParams.cConDefine16"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择${comment}">
        </el-date-picker>
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['vencontact:vencontact:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['vencontact:vencontact:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['vencontact:vencontact:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['vencontact:vencontact:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="vencontactList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="联系人编码" align="center" prop="cContactCode" />
      <el-table-column label="所属供应商" align="center" prop="cVenCode" />
      <el-table-column label="联系人名称" align="center" prop="cContactName" />
      <el-table-column label="称呼" align="center" prop="cAppellation" />
      <el-table-column label="性别" align="center" prop="bcSexID" />
      <el-table-column label="生日" align="center" prop="dBirthday" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dBirthday, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="籍贯" align="center" prop="cNative" />
      <el-table-column label="职务" align="center" prop="bcDutyID" />
      <el-table-column label="直接上级" align="center" prop="cSuperiorID" />
      <el-table-column label="手机" align="center" prop="cMobilePhone" />
      <el-table-column label="办公电话" align="center" prop="cOfficePhone" />
      <el-table-column label="家庭电话" align="center" prop="cHomePhone" />
      <el-table-column label="呼机" align="center" prop="cCall" />
      <el-table-column label="电子邮件" align="center" prop="cEmail" />
      <el-table-column label="个人主页" align="center" prop="cHomePage" />
      <el-table-column label="  工作地址 " align="center" prop="cWorkAddress" />
      <el-table-column label="邮政编码" align="center" prop="cZipcode" />
      <el-table-column label="婚姻状况" align="center" prop="bcMarriageID" />
      <el-table-column label="家庭成员" align="center" prop="cHomeMember" />
      <el-table-column label="家庭住址" align="center" prop="cHomeAddress" />
      <el-table-column label="个人爱好" align="center" prop="bcTasteID" />
      <el-table-column label="是否主要联系人" align="center" prop="bMajor" />
      <el-table-column label="备注" align="center" prop="cMemo" />
      <el-table-column label="负责人 " align="center" prop="cPrincipal" />
      <el-table-column label="创建人" align="center" prop="cCreator" />
      <el-table-column label="变更人" align="center" prop="cRevisor" />
      <el-table-column label="变更时间" align="center" prop="dModifyDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dModifyDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建日期" align="center" prop="dCreateDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dCreateDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="${comment}" align="center" prop="cConDefine1" />
      <el-table-column label="${comment}" align="center" prop="cConDefine2" />
      <el-table-column label="${comment}" align="center" prop="cConDefine3" />
      <el-table-column label="${comment}" align="center" prop="cConDefine4" />
      <el-table-column label="${comment}" align="center" prop="cConDefine5" />
      <el-table-column label="${comment}" align="center" prop="cConDefine6" />
      <el-table-column label="${comment}" align="center" prop="cConDefine7" />
      <el-table-column label="${comment}" align="center" prop="cConDefine8" />
      <el-table-column label="${comment}" align="center" prop="cConDefine9" />
      <el-table-column label="${comment}" align="center" prop="cConDefine10" />
      <el-table-column label="${comment}" align="center" prop="cConDefine11" />
      <el-table-column label="${comment}" align="center" prop="cConDefine12" />
      <el-table-column label="${comment}" align="center" prop="cConDefine13" />
      <el-table-column label="${comment}" align="center" prop="cConDefine14" />
      <el-table-column label="${comment}" align="center" prop="cConDefine15" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.cConDefine15, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="${comment}" align="center" prop="cConDefine16" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.cConDefine16, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="时间戳" align="center" prop="ufts" /> -->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['vencontact:vencontact:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['vencontact:vencontact:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改vencontact对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="联系人主键" prop="OID">
          <el-input v-model="form.OID" placeholder="请输入联系人主键" />
        </el-form-item>
        <el-form-item label="联系人编码" prop="cContactCode">
          <el-input v-model="form.cContactCode" placeholder="请输入联系人编码" />
        </el-form-item>
        <el-form-item label="所属供应商" prop="cVenCode">
          <el-input v-model="form.cVenCode" placeholder="请输入所属供应商" />
        </el-form-item>
        <el-form-item label="联系人名称" prop="cContactName">
          <el-input v-model="form.cContactName" placeholder="请输入联系人名称" />
        </el-form-item>
        <el-form-item label="称呼" prop="cAppellation">
          <el-input v-model="form.cAppellation" placeholder="请输入称呼" />
        </el-form-item>
        <el-form-item label="性别" prop="bcSexID">
          <el-input v-model="form.bcSexID" placeholder="请输入性别" />
        </el-form-item>
        <el-form-item label="生日" prop="dBirthday">
          <el-date-picker clearable
            v-model="form.dBirthday"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择生日">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="籍贯" prop="cNative">
          <el-input v-model="form.cNative" placeholder="请输入籍贯" />
        </el-form-item>
        <el-form-item label="职务" prop="bcDutyID">
          <el-input v-model="form.bcDutyID" placeholder="请输入职务" />
        </el-form-item>
        <el-form-item label="直接上级" prop="cSuperiorID">
          <el-input v-model="form.cSuperiorID" placeholder="请输入直接上级" />
        </el-form-item>
        <el-form-item label="手机" prop="cMobilePhone">
          <el-input v-model="form.cMobilePhone" placeholder="请输入手机" />
        </el-form-item>
        <el-form-item label="办公电话" prop="cOfficePhone">
          <el-input v-model="form.cOfficePhone" placeholder="请输入办公电话" />
        </el-form-item>
        <el-form-item label="家庭电话" prop="cHomePhone">
          <el-input v-model="form.cHomePhone" placeholder="请输入家庭电话" />
        </el-form-item>
        <el-form-item label="呼机" prop="cCall">
          <el-input v-model="form.cCall" placeholder="请输入呼机" />
        </el-form-item>
        <el-form-item label="电子邮件" prop="cEmail">
          <el-input v-model="form.cEmail" placeholder="请输入电子邮件" />
        </el-form-item>
        <el-form-item label="个人主页" prop="cHomePage">
          <el-input v-model="form.cHomePage" placeholder="请输入个人主页" />
        </el-form-item>
        <el-form-item label="  工作地址 " prop="cWorkAddress">
          <el-input v-model="form.cWorkAddress" placeholder="请输入  工作地址 " />
        </el-form-item>
        <el-form-item label="邮政编码" prop="cZipcode">
          <el-input v-model="form.cZipcode" placeholder="请输入邮政编码" />
        </el-form-item>
        <el-form-item label="婚姻状况" prop="bcMarriageID">
          <el-input v-model="form.bcMarriageID" placeholder="请输入婚姻状况" />
        </el-form-item>
        <el-form-item label="家庭成员" prop="cHomeMember">
          <el-input v-model="form.cHomeMember" placeholder="请输入家庭成员" />
        </el-form-item>
        <el-form-item label="家庭住址" prop="cHomeAddress">
          <el-input v-model="form.cHomeAddress" placeholder="请输入家庭住址" />
        </el-form-item>
        <el-form-item label="个人爱好" prop="bcTasteID">
          <el-input v-model="form.bcTasteID" placeholder="请输入个人爱好" />
        </el-form-item>
        <el-form-item label="是否主要联系人" prop="bMajor">
          <el-input v-model="form.bMajor" placeholder="请输入是否主要联系人" />
        </el-form-item>
        <el-form-item label="备注" prop="cMemo">
          <el-input v-model="form.cMemo" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="负责人 " prop="cPrincipal">
          <el-input v-model="form.cPrincipal" placeholder="请输入负责人 " />
        </el-form-item>
        <el-form-item label="创建人" prop="cCreator">
          <el-input v-model="form.cCreator" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="变更人" prop="cRevisor">
          <el-input v-model="form.cRevisor" placeholder="请输入变更人" />
        </el-form-item>
        <el-form-item label="变更时间" prop="dModifyDate">
          <el-date-picker clearable
            v-model="form.dModifyDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择变更时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="创建日期" prop="dCreateDate">
          <el-date-picker clearable
            v-model="form.dCreateDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择创建日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine1">
          <el-input v-model="form.cConDefine1" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine2">
          <el-input v-model="form.cConDefine2" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine3">
          <el-input v-model="form.cConDefine3" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine4">
          <el-input v-model="form.cConDefine4" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine5">
          <el-input v-model="form.cConDefine5" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine6">
          <el-input v-model="form.cConDefine6" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine7">
          <el-input v-model="form.cConDefine7" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine8">
          <el-input v-model="form.cConDefine8" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine9">
          <el-input v-model="form.cConDefine9" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine10">
          <el-input v-model="form.cConDefine10" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine11">
          <el-input v-model="form.cConDefine11" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine12">
          <el-input v-model="form.cConDefine12" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine13">
          <el-input v-model="form.cConDefine13" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine14">
          <el-input v-model="form.cConDefine14" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine15">
          <el-date-picker clearable
            v-model="form.cConDefine15"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择${comment}">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="${comment}" prop="cConDefine16">
          <el-date-picker clearable
            v-model="form.cConDefine16"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择${comment}">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listVencontact, getVencontact, delVencontact, addVencontact, updateVencontact } from "@/api/vencontact/vencontact";

export default {
  name: "Vencontact",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // vencontact表格数据
      vencontactList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        cContactCode: null,
        cVenCode: null,
        cContactName: null,
        cAppellation: null,
        bcSexID: null,
        dBirthday: null,
        cNative: null,
        bcDutyID: null,
        cSuperiorID: null,
        cMobilePhone: null,
        cOfficePhone: null,
        cHomePhone: null,
        cCall: null,
        cEmail: null,
        cHomePage: null,
        cWorkAddress: null,
        cZipcode: null,
        bcMarriageID: null,
        cHomeMember: null,
        cHomeAddress: null,
        bcTasteID: null,
        bMajor: null,
        cMemo: null,
        cPrincipal: null,
        cCreator: null,
        cRevisor: null,
        dModifyDate: null,
        dCreateDate: null,
        cConDefine1: null,
        cConDefine2: null,
        cConDefine3: null,
        cConDefine4: null,
        cConDefine5: null,
        cConDefine6: null,
        cConDefine7: null,
        cConDefine8: null,
        cConDefine9: null,
        cConDefine10: null,
        cConDefine11: null,
        cConDefine12: null,
        cConDefine13: null,
        cConDefine14: null,
        cConDefine15: null,
        cConDefine16: null,
        ufts: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询vencontact列表 */
    getList() {
      this.loading = true;
      listVencontact(this.queryParams).then(response => {
        this.vencontactList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        OID: null,
        cContactCode: null,
        cVenCode: null,
        cContactName: null,
        cAppellation: null,
        bcSexID: null,
        dBirthday: null,
        cNative: null,
        bcDutyID: null,
        cSuperiorID: null,
        cMobilePhone: null,
        cOfficePhone: null,
        cHomePhone: null,
        cCall: null,
        cEmail: null,
        cHomePage: null,
        cWorkAddress: null,
        cZipcode: null,
        bcMarriageID: null,
        cHomeMember: null,
        cHomeAddress: null,
        bcTasteID: null,
        bMajor: null,
        cMemo: null,
        cPrincipal: null,
        cCreator: null,
        cRevisor: null,
        dModifyDate: null,
        dCreateDate: null,
        cConDefine1: null,
        cConDefine2: null,
        cConDefine3: null,
        cConDefine4: null,
        cConDefine5: null,
        cConDefine6: null,
        cConDefine7: null,
        cConDefine8: null,
        cConDefine9: null,
        cConDefine10: null,
        cConDefine11: null,
        cConDefine12: null,
        cConDefine13: null,
        cConDefine14: null,
        cConDefine15: null,
        cConDefine16: null,
        ufts: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.OID)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加vencontact";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const OID = row.OID || this.ids
      getVencontact(OID).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改vencontact";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.OID != null) {
            updateVencontact(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addVencontact(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const OIDs = row.OID || this.ids;
      this.$modal.confirm('是否确认删除vencontact编号为"' + OIDs + '"的数据项？').then(function() {
        return delVencontact(OIDs);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('vencontact/vencontact/export', {
        ...this.queryParams
      }, `vencontact_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
